package com.example.converter.config;

import com.example.converter.enums.VideoTypeEnum;
import org.springframework.core.convert.converter.Converter;
import org.springframework.format.FormatterRegistry;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Component
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addFormatters(FormatterRegistry registry) {
//        registry.addConverter(new StringToEnumConverter<String, VideoTypeEnum>());
//        registry.addConverter(new StringToEnumConverter2());
        registry.addConverterFactory(new EnumsConvertorFactory());
//        registry.addConverterFactory(new StringToEnumConverterFactory());
    }
}
